﻿using personalplaner.common;
using personalplaner.common.mvvm.common;
using personalplaner.common.mvvm.factory;
using personalplaner.servicemodel.dataaccess;

namespace personalplaner.gui.settings.viewmodels.factories
{
	public class SettingsModelFactory : IFactory
	{
		#region IFactory Members

		public object CreateViewModel(System.Windows.DependencyObject sender)
		{
			if (Designer.IsDesignMode)
				return null;


			var vm = new SettingsViewModel(sender);

            vm.ServiceLocator.RegisterService<IOptionsDataAccess>(new OptionsDataAccess(SettingsProvider.Settings), false);

			return vm;

		}

		#endregion
	}
}
